<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>热线视频首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all">
    <script th:src="@{/layui/layui.js}" charset="utf-8"></script>
    <script th:src="@{/js/jquery-2.2.3.min.js}" charset="utf-8"></script>

    <link rel="shortcut icon" href="../resources/favicon.ico" th:href="@{/static/favicon.ico}"/>

    <script>

    </script>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form" id="adminproject" >
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" required  autocomplete="on"
                   class="layui-input" id="title">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">详细内容</label>
        <div class="layui-input-block">
<!--            <input type="text" name="content" required  autocomplete="on"-->
<!--                   class="layui-input" id="content" size="100">-->
            <textarea    required name="content" id="content" style="width: 800px;height: 100px"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">希望完成时间</label>
        <div class="layui-input-block">
            <input type="date" name="hopetime" lay-verify="required" autocomplete="on"
                   class="layui-input" id="hopetime">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">分类标签</label>
        <div class="layui-input-block">
            <select id="kind" name="kind" lay-verify="required" lay-filter="business" class="select">
                <option value=""></option>
                <option value="软件系统故障">软件系统故障</option>
                <option value="硬件系统故障">硬件系统故障</option>
                <option value="网络安全">网络安全</option>
                <option value="其他">其他</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">紧急程度</label>
        <div class="layui-input-block">
            <select id="urgent" name="urgent" lay-verify="required" lay-filter="business" class="select">
                <option value=""></option>
                <option value="高">高</option>
                <option value="中">中</option>
                <option value="低">低</option>
            </select>
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>

        </div>
    </div>
</form>
<script>
    layui.use(['form'], function(){
        var form = layui.form
            ,layer = layui.layer




        //监听提交
        form.on('submit(demo1)', function(data){
            var title = $("#title").val();
            var hopetime = $("#hopetime").val();
            var author = $("#author").val();
            var kind = $("#kind").val();
            var content = $("#content").val();
            var urgent = $("#urgent").val();
            $.ajax({
                url: '/support/chartlistadd',
                type: "POST",
                traditional: true,
                data: {
                    "title": title,
                    "hopetime": hopetime,
                    "kind": kind,
                    "content": content,
                    "urgent": urgent,

                },
                success: function () {

                    location.reload();
                    layer.msg('添加成功');


                }
            });

            return false;
        });



    });
</script>












</body>
</html>